package com.google.coffeeshop.dao.impl;

import com.google.coffeeshop.dao.UserDAO;
import com.google.coffeeshop.entity.UserDTO;
import com.googlecode.genericdao.search.Search;

public class UserDAOImpl extends AbstractBaseDAOImpl<UserDTO, Long> implements UserDAO {

	public UserDTO findActiveByUsername(String username) {
		Search search = new Search(UserDTO.class);
		search.setFirstResult(0);
		search.setMaxResults(1);
		search.addFilterEqual("username", username);
		search.addFilterEqual("active", Boolean.TRUE);
		return this.searchUnique(search);
	}
}
